﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    习题管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderPartial("AdminTopUc", "习题管理"); %>
    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table03">
        <%using (Ajax.BeginForm("LibListUc", new AjaxOptions { UpdateTargetId = "listDiv", HttpMethod = "Get" }))
          { %>
        <tr class="box06">
            <td width="16%" height="27" align="center">
                <div align="right">
                    试题内容:</div>
            </td>
            <td width="20%" align="center" class="bg3">
                <div align="left">
                    <input name="search" type="text" size="18" />
                </div>
            </td>
            <td width="10%" align="center">
                <div align="right">
                    章:</div>
            </td>
            <td width="20%" align="center" class="bg3">
                <div align="left">
                     <select name="ChapterIdSearch" id="ChapterIdSearch">
                        <option value="0">请选择</option>
                    </select>
                </div>
            </td>
            <td width="10%" align="center">
                <div align="right">
                    节:</div>
            </td>
            <td width="20%" align="center" class="bg3">
                <div align="left">
                     <select name="SectionIdSearch" id="SectionIdSearch">
                        <option value="0">请选择</option>
                    </select>
                </div>
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table03">
        <tr class="box06">
            <td width="8%" align="center" class="box06">
                <div align="right">
                    试题类型:</div>
            </td>
            <td width="11%" align="center" class="bg3">
                <div align="left">
                    <select name="ddlQtType" id="ddlQtType">
                        <option value="-1">-- 请选择 --</option>
                        <option value="0">单选题</option>
                        <option value="1">多选题</option>
                        <option value="2">判断题</option>
                        <option value="3">论述题</option>
                        <option value="4">思考题</option>
                    </select>
                </div>
            </td>
            <td width="16%" align="center" class="box06">
                <div align="right">
                    难度系数从:</div>
            </td>
            <td width="30%" class="bg3">
                <%=Html.TextBox("ddlMinDiff")%>
                到 <%=Html.TextBox("ddlMaxDiff")%>
            </td>
            <td width="12%" align="center" class="bg3">
                <div align="left">
                    <input type="submit" name="Submit" value="搜索" /><input type="button" id="addLib"
                        value="添加题目" />
                </div>
            </td>
        </tr>
        <%} %>
    </table>
    <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
        <tr>
            <td height="5" bgcolor="#FFFFFF">
            </td>
        </tr>
    </table>
    <div id="listDiv">
        <% Html.RenderAction("LibListUc"); %>
    </div>
    <div id="editDiv" title="添加题目">
    </div>
    <input type="hidden" value="0" id="reload" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <script type="text/javascript">
        $(function () {
            selectLoad("ChapterIdSearch", "Ajax/GetChapterDef");
            selectChangeLoad("SectionIdSearch", "ChapterIdSearch", "Ajax/GetSection/");
            $("#editDiv").dialog({
                autoOpen: false,
                height: 400,
                width: 550,
                modal: true,
                close: function () {
                    if ($("#jump").val() != "" && $("#jump").val() != null) {
                        window.location = appRoot + "AdminExamLib/AnswerEdit/" + $("#jump").val();
                        return;
                    }
                    var reload = $("#reload").val();
                    if (reload == 1)
                        window.location.reload();
                }
            });

            $("#addLib")
			.click(function () {
			    $("#reload").val(0);
			    $("#editDiv").html("loading...");
			    $("#editDiv").load(appRoot + 'AdminExamLib/LibEditUc/?rd='+rdTime());
			    $("#editDiv").dialog("open");
			});
        });
        var editClickA = function (id) {
            $("#editDiv").html("loading...");
            $("#editDiv").load(appRoot + 'AdminExamLib/LibEditUc/' + id+'?rd='+rdTime());
            $("#reload").val(1);
            $("#editDiv").dialog("open");
        };

        var jump2Edit = function () {
            if ($("#jump").val() != "" && $("#jump").val() != null) {
                window.location = appRoot + "AdminExamLib/AnswerEdit/" + $("#jump").val();
                return;
            }
        };
    </script>
</asp:Content>
